<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>color animate.</title>
    <!--<link rel="stylesheet" href="../libs/jqueryui/1.11.4/jquery-ui.css">-->
    <script type="text/javascript" src="../libs/jquery/1.11.1/jquery.js"></script>
    <script type="text/javascript" src="../libs/jqueryui/1.11.4/jquery-ui.js"></script>
    <style>
        #div1 {
            background-color: blue;
            color: #ffffff;
            width: 500px;
        }
    </style>
    <script>
        $(function(){
            var state = true;
            $('#btn').click(function(){
                if(state){
                    $('#div1').animate({
                        backgroundColor: 'yellow',
                        color: '#000000',
                        width: 240
                    },1000);
                }else{
                    $('#div1').animate({
                        backgroundColor: 'blue',
                        color: '#ffffff',
                        width: 500
                    },1000);
                }
                state = !state;
            });
        });
    </script>
</head>
<body>

    <div id="div1">
        你好,欢迎光临!请随意!窗前明月光,疑是地上霜.举头望明月,低头思故乡.日照香炉生紫烟,遥看瀑布挂前川.飞流直下三千尺,疑是银河落九天.
    </div>
    <br>
    <input type="button" id="btn" value="点击"/>

</body>
</html>